#include "fontdialog.h"
#include <QFontDialog>

FontDialog::FontDialog(QWidget *parent)
    : QDialog(parent)
{
    fontBtn = new QPushButton(tr("Font"));
    fontLineEdit = new QLineEdit();
    fontLineEdit->setText(tr("Welcome!"));
    mainLayout = new QGridLayout(this);
    mainLayout->addWidget(fontBtn, 0, 0);
    mainLayout->addWidget(fontLineEdit, 0, 1);

    connect(fontBtn, SIGNAL(clicked()), this, SLOT(showFont()));
}

FontDialog::~FontDialog()
{

}

void FontDialog::showFont()
{
    bool ok;
    QFont f = QFontDialog::getFont(&ok);
    if(ok)
        fontLineEdit->setFont(f);
}
